package Observer;

import java.util.ArrayList;
import java.util.List;

/**
 * @className: WXNotify
 * @Auther: jiesen.liu
 * @Date: 2019/7/22 17:40
 * @package: Observer
 */
public class WXNotify implements notify {

    private List<ObServerUser> users = new ArrayList<>();

    @Override
    public void addNotify(ObServerUser user) {
        users.add(user);
    }

    @Override
    public void removeUser(ObServerUser user) {
        users.remove(user);
    }

    @Override
    public void notifyAll(String value) {
        for (ObServerUser user: users) {
            user.update(value);
        }
    }
}
